package com.zb.mvc.controller.base;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zb.entity.base.JsonForList;
import com.zb.entity.base.OmsPubOperCommend;
import com.zb.service.base.PubOperCommendService;
import com.zb.util.ActionUtils;

/**
 * 
 * @author huanghao
 *
 */
@Controller
@RequestMapping("/pubOperCommendApi")
public class PubOperCommendAction extends BaseAction
{
	@Autowired
	private PubOperCommendService pubOperCommendServiceImpl;
	
	@RequestMapping(value="findAllOrPage",method=RequestMethod.GET)
	@ResponseBody
	public JsonForList<?> findAllOrPage(HttpServletRequest request, HttpServletResponse response)
	{
		return pubOperCommendServiceImpl.findPageObjs(this.buildQueryParam(request, true), this.getObjFromRequest(request,false,true));
	}
	
	private OmsPubOperCommend getObjFromRequest(HttpServletRequest request,boolean isCreate,boolean isFind)
	{
		String loginUserId = this.getLoginUserId(request);
		return ActionUtils.getParamInstance(OmsPubOperCommend.class, ActionUtils.getParameterMap(request),loginUserId,isCreate,isFind);
	}
}
